<template>
  <div>
    <van-card
      :desc="item.zhaiyao"
      :title="item.title"
      :thumb="item.img_url"
      v-for="item in newList"
      :key="item.id"
      :thumb-link="'#/home/newsinfo/'+item.id"
    >
      <template #bottom>
        <div class="bottomGroup">
          <span class="btitle">{{item.add_time}}</span>
          <span>点击{{item.click}}次</span>
        </div>
      </template>
    </van-card>
  </div>
</template>

<script>
import { getNewList } from '@/api/newlList'
export default {
  data () {
    return {
      newList: []
    }
  },
  created () {
    this.getNewList()
  },
  methods: {
    async getNewList () {
      const res = await getNewList()
      console.log(res)
      this.newList = res.data.message
    }
  }
}
</script>

<style scoped>
.bottomGroup {
  display: flex;
  justify-content: space-between;
}
.btitle {
  color: red;
}
.van-card__content {
  min-height: 68px;
}
.van-card__thumb {
  height: 68px;
}
.van-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
</style>